﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using WOIM_NET.Annotations;

namespace WOIM_NET.Music
{
    public class SongModel : INotifyPropertyChanged
    {
        private string _name;
        private string _url;
        private string _avatar;
        private string _artist;
        private string _instrumental;
        private string _album;
        private string _linktoAlbum;

        public string Album
        {
            get { return _album; }
            set
            {
                if (value == _album) return;
                _album = value;
                OnPropertyChanged();
            }
        }

        public string LinktoAlbum
        {
            get { return _linktoAlbum; }
            set
            {
                if (value == _linktoAlbum) return;
                _linktoAlbum = value;
                OnPropertyChanged();
            }
        }

        public string Name
        {
            get { return _name; }
            set
            {
                if (value == _name) return;
                _name = value;
                OnPropertyChanged("Name");
            }
        }

        public string Url
        {
            get { return _url; }
            set
            {
                if (value == _url) return;
                _url = value;
                OnPropertyChanged("Url");
            }
        }

        public string Avatar
        {
            get { return _avatar; }
            set
            {
                if (value == _avatar) return;
                _avatar = value;
                OnPropertyChanged("Avatar");
            }
        }

        public string Instrumental
        {
            get { return _instrumental; }
            set
            {
                if (value == _instrumental) return;
                _instrumental = value;
                OnPropertyChanged("Instrumental");
            }
        }

        public string Artist
        {
            get { return _artist; }
            set
            {
                if (value == _artist) return;
                _artist = value;
                OnPropertyChanged("Artist");
            }
        }


        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
